import time

from pages.basePage3 import  BasePage
from config.setting import host_port
class ElmentFeedback(BasePage):
    def __init__(self):
        BasePage.__init__(self)
        self.driver.get(f"http://{host_port}/SharedParkingPlace/property/index.html")

    # 定位层
    # 定位订单管理
        # 定位订单管理
    def elment_dingdanguanli(self):
        return self.driver.find_element_by_xpath('//div[@id="main"]/div[1]/div[1]/div[1]/div[1]')
    # 定位评价管理
    def elment_pingjia(self):
        return self.driver.find_element_by_xpath('//div[@id="_easyui_tree_2"]/span[3]')

    # 定位表单
    def elment_biaodan(self):
        a = self.driver.find_element_by_xpath('//div[@id="testIframe"]/div[2]/div[2]/div/iframe')
        return a

    # 定位文本框
    def elment_yemian(self):
        return self.driver.find_element_by_xpath('/html[@class="panel-fit"]/body/div/div[1]')

class option_Feedback(ElmentFeedback):
    # 操作层
    def __init__(self):
        ElmentFeedback.__init__(self)

    # 点击订单管理
    def click_dingdanguanli(self):
        self.elment_dingdanguanli().click()

    #     点击查看订单
    def click_pingjia(self):
        self.elment_pingjia().click()

    # 切换表单
    def get_biaodan(self):
        c = self.elment_biaodan()
        return self.driver.switch_to.frame(c)

    # 获取文本框内容
    def text_yemian(self):
        return self.elment_yemian().text

class Feedback01(option_Feedback):
    # 应用层
    def __init__(self):
        option_Feedback.__init__(self)

    def order1(self):
        time.sleep(1)
        self.click_dingdanguanli()
        self.click_pingjia()
        self.get_biaodan()
        b = self.text_yemian()

        return b


if __name__ == '__main__':
    Feedback01().order1()
#  定位表单
# 获取文本框内容
